{{define "nav.html"}}
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="/res/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
                </div>
                <div class="pull-left info">
                    <p id="systemUserName"></p>
                    <a href="#"><i class="fa fa-circle text-success"></i><span id="systemOrganName"></span></a>
                </div>
            </div>

            <ul class="sidebar-menu" id="sidebar-menu" data-widget="tree" style="font-size: 18px;">
                <li class="header">系统功能菜单</li>
                {{/*<li class="treeview">
                <a href="#">
                    <i class="fa fa-dashboard"></i> <span>系统管理</span>
                    <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                </a>
            </li>
            <li style="padding-left: 20px;"><a href="/system/user/add"><i class="fa fa-circle-o"></i> 添加管理员账号</a></li>
            <li style="padding-left: 20px;"><a href="/system/user/edit"><i class="fa fa-user-plus"></i>&nbsp;修改管理员密码</a></li>
            <li class="treeview">
                <a href="#">
                    <i class="fa fa-book"></i> <span>筛查管理</span>
                    <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                </a>
            </li>
            <li style="padding-left: 20px;"><a href="/infoCollection"><i class="fa fa-users"></i>&nbsp;筛查数据</a></li>
            <li style="padding-left: 20px;"><a href="/system/main"><i class="fa fa-users"></i>&nbsp;筛查统计</a></li>*/}}
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>
    <script>
        $.post("/system/user/getUserInfo", {}, function (resp) {
            if (resp.code == 0) {
                let systemUserName = resp.data.name;
                let organName = resp.data.organName;
                let menus = resp.data.menus;
                //alert(systemUserName+" "+organName);
                if (systemUserName && systemUserName != null) {
                    $("#systemUserName").html(systemUserName);
                    $("#systemOrganName").html(organName);
                }
                if (menus) {
                    $("#sidebar-menu").html("");
                    $.each(menus, function (index,obj) {

                        let li = $("<li><a href='" + obj.url + "'><i class='" + obj.icon + "'></i> " + obj.name + "</a></li>");
                        if(obj.parent){
                            li.attr("class","treeview");
                        }else{
                            li.css("padding-left","20px");
                        }
                        $("#sidebar-menu").append(li);
                    });
                }
            }
        }, 'json')
    </script>
{{end}}